<template>
  <div>
    <el-drawer
      title="选择行业类型"
      :visible.sync="show"
      :direction="direction"
      :before-close="handleClose"
    >
      <div class="m-tree-box">
        <el-tree
          ref="tree"
          :data="studentTree"
          :props="defaultProps"
          :highlight-current="true"
          node-key="id"
          :default-expanded-keys="defaultShowNodes"
          @node-click="handleTree"
        >
        </el-tree>
      </div>
    </el-drawer>
  </div>
</template>

<script>
export default {
  name: "IndustryType",
  props: {
    industryTypeVisible: {
      type: Boolean,
      default() {
        return false;
      },
    },
  },
  data() {
    return {
      studentTree: [
        {
          id: 1,
          label: "客户行业树",
          children: [
            {
              id: 4,
              label: "要客服务",
              children: [
                {
                  id: 9,
                  label: "三级 1-1-1",
                },
                {
                  id: 10,
                  label: "三级 1-1-2",
                },
              ],
            },
            {
              id: 4,
              label: "商业客户",
              children: [
                {
                  id: 9,
                  label: "三级 1-1-1",
                },
                {
                  id: 10,
                  label: "三级 1-1-2",
                },
              ],
            },
            {
              id: 4,
              label: "应急行业",
              children: [
                {
                  id: 9,
                  label: "三级 1-1-1",
                },
                {
                  id: 10,
                  label: "三级 1-1-2",
                },
              ],
            },
          ],
        },
      ],
      defaultShowNodes: [], // 这里存放要默认展开的节点 id

      defaultProps: {
        children: "children",
        label: "label",
      },
    };
  },

  components: {},
  created() {},
  mounted() {
    this.studentTree.forEach((item) => {
      
      this.defaultShowNodes.push(item.id);
      
    });
  },
  methods: {
    handleClose() {
      this.show = false;
    },
    handleTree() {
      
    },
  },
};
</script>
<style lang="scss" scoped>
.m-tree-box {
  padding: 30px;
}
</style>
